ODBCgetResult | OLE2close |
Syntax: @OLE2call Channel, Method [, Param][: Param]
The OLE2call command will call a particular OLE2 automation method on a previously opened automation server.
Channel: A channel number which has been assigned by a previous call to the @OLE2open
Method: A string which holds the name of the particular method to call on the OLE2 automation channel.
Param: These are the parameters which the specified method requires. The types and number of parameters must match those expected by the method. If the method is a function and returns a value, then use the ": Param" option to store the result in a variable.
Example
@OLE2call word_channel , 'GetBookmark' , 'bookmark1' : bookmark_str
The above line returns the text contained in 'bookmark1' from the Microsoft Word for Windows OLE2 channel.
Functions such as this can be found in the MS-Word online help under 'Wordbasic'.
Interface to OLE2 Automation Servers
The @OLE2call command also allows interfaces to be used as its parameters. For example:
@OLE2Open 'myobject',i1
@OLE2Call i1,'subInterface':&i2
@OLE2Call i1,'aMethod',*i2
@OLE2Close i2
@OLE2Close i1
Note that the (*i2) signifies the interface referenced by the i2 number and not the i2 number itself.